#import "BaseTabBarController.h"
#import "BaseNavigationController.h"
#import "ASGChooseCityController.h"
#import "TBRMineController.h"
#import "TBRHomeViewC.h"
//#import "TBRTextMapController.h"
#import "TBROrderListC.h"
#import "TBRRegisterController.h"
#import "UIColor+Hex.h"
#define sFirstTimeLaunchedMarkKey               @"firstTimeLaunchedMark"

@interface BaseTabBarController ()
{
    BOOL _isAppProfileVisible;
}
@end

@implementation BaseTabBarController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.tabBar.barTintColor = [UIColor blackColor];
    [self addClientChildControllers];
}

// MARK: -  添加子控制器-------
- (void)addClientChildControllers {
    TBRHomeViewC *homeC = [[TBRHomeViewC alloc] init];
    [self setUpOneChildController:homeC Title:@"首页" ImageName:@"办公" SelectImageName:@""];
    
    TBROrderListC *orderC = [TBROrderListC new];
    [self setUpOneChildController:orderC Title:@"订单" ImageName:@"办公" SelectImageName:@""];
    ASGChooseCityController *chooseCityController = [[ASGChooseCityController alloc] init];
    [self setUpOneChildController:chooseCityController Title:@"选择" ImageName:@"办公" SelectImageName:@""];
    //个人
    //    ALMeController *alMeC = [[ALMeController alloc] init];
    TBRMineController *mineC = [TBRMineController new];
    [self setUpOneChildController:mineC Title:@"我的" ImageName:@"我" SelectImageName:@""];
}


//添加一个子控制器
- (void)setUpOneChildController:(UIViewController *)vc Title:(NSString *)title ImageName:(NSString *)imageName SelectImageName:(NSString *)selectImageName {
    vc.title = title;
    vc.tabBarItem.image = [UIImage imageNamed:imageName];
    vc.tabBarItem.selectedImage = [UIImage imageNamed:selectImageName];
    BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
    [self addChildViewController:nav];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

//- (void)launchTimeInfoCheck
//{
//    NSString *markKey = sFirstTimeLaunchedMarkKey;
//    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
//    BOOL isFirstTimeToLaunch = ![userDefaults boolForKey:markKey];
//    if(isFirstTimeToLaunch)
//    {
//        [userDefaults setBool:YES forKey:markKey];
//        [userDefaults synchronize];
//    }
//    _isAppProfileVisible = isFirstTimeToLaunch;
//}


@end
